package com.ruoyi.fitsculpt.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fitsculpt.mapper.EasyfitExercisePlansMapper;
import com.ruoyi.fitsculpt.domain.EasyfitExercisePlans;
import com.ruoyi.fitsculpt.service.IEasyfitExercisePlansService;

/**
 * 运动计划Service业务层处理
 *
 * @author metaee
 * @date 2025-02-27
 */
@Service
public class EasyfitExercisePlansServiceImpl implements IEasyfitExercisePlansService {
    @Autowired
    private EasyfitExercisePlansMapper easyfitExercisePlansMapper;

    /**
     * 查询运动计划
     *
     * @param planId 运动计划主键
     * @return 运动计划
     */
    @Override
    public EasyfitExercisePlans selectEasyfitExercisePlansByPlanId(Long planId) {
        return easyfitExercisePlansMapper.selectEasyfitExercisePlansByPlanId(planId);
    }

    /**
     * 查询运动计划列表
     *
     * @param easyfitExercisePlans 运动计划
     * @return 运动计划
     */
    @Override
    public List<EasyfitExercisePlans> selectEasyfitExercisePlansList(EasyfitExercisePlans easyfitExercisePlans) {
        return easyfitExercisePlansMapper.selectEasyfitExercisePlansList(easyfitExercisePlans);
    }

    /**
     * 新增运动计划
     *
     * @param easyfitExercisePlans 运动计划
     * @return 结果
     */
    @Override
    public int insertEasyfitExercisePlans(EasyfitExercisePlans easyfitExercisePlans) {
        easyfitExercisePlans.setCreateTime(DateUtils.getNowDate());
        return easyfitExercisePlansMapper.insertEasyfitExercisePlans(easyfitExercisePlans);
    }

    /**
     * 修改运动计划
     *
     * @param easyfitExercisePlans 运动计划
     * @return 结果
     */
    @Override
    public int updateEasyfitExercisePlans(EasyfitExercisePlans easyfitExercisePlans) {
        easyfitExercisePlans.setUpdateTime(DateUtils.getNowDate());
        return easyfitExercisePlansMapper.updateEasyfitExercisePlans(easyfitExercisePlans);
    }

    /**
     * 批量删除运动计划
     *
     * @param planIds 需要删除的运动计划主键
     * @return 结果
     */
    @Override
    public int deleteEasyfitExercisePlansByPlanIds(Long[] planIds) {
        return easyfitExercisePlansMapper.deleteEasyfitExercisePlansByPlanIds(planIds);
    }

    /**
     * 删除运动计划信息
     *
     * @param planId 运动计划主键
     * @return 结果
     */
    @Override
    public int deleteEasyfitExercisePlansByPlanId(Long planId) {
        return easyfitExercisePlansMapper.deleteEasyfitExercisePlansByPlanId(planId);
    }

    /**
     * 根据ID查询运动计划
     * 
     * @param id 运动计划ID
     * @return 运动计划信息
     */
    @Override
    public EasyfitExercisePlans selectEasyfitExercisePlansById(Long id) {
        return easyfitExercisePlansMapper.selectEasyfitExercisePlansById(id);
    }
}
